package com.pocket.demo;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.slf4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author zhaozhile
 */
@EnableScheduling
@EnableAdminServer
@RestController
@SpringBootApplication
public class DemoApplication {

	private static final Logger logger = org.slf4j.LoggerFactory.getLogger(DemoApplication.class);
	public static void main(String[] args) {

		SpringApplication.run(DemoApplication.class, args);

		// 在某些情况下（如ES连接错误），会启动失败，但控制台不会有任何异常打印，需要使用 try-catch 捕获打印异常
		// 在引入 devtools 热部署插件时，建议注释掉，不然启动会打印异常 org.springframework.boot.devtools.restart.SilentExitExceptionHandlerSSilentExitException
//		try {
//			SpringApplication.run(DemoApplication.class, args);
//		} catch (Throwable e) {
//			logger.error("Application start error", e);
//		}
	}


}
